using System;
using Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Request;
using Sinacor.Servico.Bovespa.Ordens.BusinessEntity;

namespace Sinacor.Servico.Bovespa.Ordens.Service.ServiceImplementation.Translator
{
	public static class TranslateBetweenConsiderarSaldoOrdemRequestAndOrdem
	{
		public static Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Request.ConsiderarSaldoOrdemRequest TranslateOrdemToConsiderarSaldoOrdemRequest(Sinacor.Servico.Bovespa.Ordens.BusinessEntity.Ordem from)
		{
            if (from == null)
                return null;

			Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Request.ConsiderarSaldoOrdemRequest to = new Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Request.ConsiderarSaldoOrdemRequest();
			to.DataOrdem = from.DataOrdem.Value;
			to.NumeroOrdem = from.NumeroOrdem.Value;
			to.NumeroOrdemSequencia = from.NumeroOrdemSubSequencia.Value;
			return to;
		}

		public static Sinacor.Servico.Bovespa.Ordens.BusinessEntity.Ordem TranslateConsiderarSaldoOrdemRequestToOrdem(Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Request.ConsiderarSaldoOrdemRequest from)
		{
			Sinacor.Servico.Bovespa.Ordens.BusinessEntity.Ordem to = new Sinacor.Servico.Bovespa.Ordens.BusinessEntity.Ordem();
			to.DataOrdem = from.DataOrdem;
			to.NumeroOrdem = from.NumeroOrdem;
			to.NumeroOrdemSubSequencia = from.NumeroOrdemSequencia;
			return to;
		}
	}
}

